-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: adding unit tests for common #113
test: adding unit tests for common #113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, left just few recommendations
package.json
Outdated
"release": "semantic-release", | ||
"lint": "eslint --max-warnings 0 --fix --config .eslintrc .", | ||
"generate:readme:toc": "markdown-toc -i README.md", | ||
"generate:assets": "npm run generate:readme:toc", | ||
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION" | ||
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION", | ||
"testComponents": "rimraf test/temp && jest --coverage ./test/components" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not put anything in test/temp
so no need to remove it and using rimraf
. I guess you saw it in other templates but this is related to not unit testing but a kind of integration testing where you actually run generator and then check if generated app matches the snapshot. Definitely another set of tests I recommend to add after this PR (example asyncapi/nodejs-template#103)
test/components/common.test.js
Outdated
import { GetProtocolFlags, GetSubscriberFlags, pascalCase } from '../../components/common'; | ||
import AsyncAPIDocument from '@asyncapi/parser/lib/models/asyncapi'; | ||
|
||
const docWithoutChannels = new AsyncAPIDocument({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend to take these example files from test into separate files, and then just read them from file. This way you can share them in future with others tests, like integration tests
50f6bc4
to
8921417
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks very good, just remove rimraf
and yeah heading on to @smoya to approve as my approval doesn't count here
package.json
Outdated
@@ -33,7 +34,8 @@ | |||
"@asyncapi/generator-filters": "^2.0.0", | |||
"@asyncapi/generator-hooks": "^0.1.0", | |||
"@asyncapi/generator-react-sdk": "^0.2.23", | |||
"@asyncapi/modelina": "^0.45.0" | |||
"@asyncapi/modelina": "^0.45.0", | |||
"rimraf": "^3.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you do not use it, you can remove and update package-lock
8364de0
to
d80df90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍 🚀
🎉 This PR is included in version 0.1.35 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Adding unit tests to components